//
//  FTwitterOAuthEngine.m
//  Demo-Linked
//
//  Created by SDS on 10/18/12.
//  Copyright (c) 2012 SDS. All rights reserved.
//

#import "FTwitterOAuthEngine.h"
#import "Constant.h"
@implementation FTwitterOAuthEngine

- (id)initWithDelegate:(id<FOAuthDelegate>)delegate{
    self = [self initWithConsumerKey:kTwitterApiKey consumerSecret:kTwitterApiSceretKey delegate:delegate];
    
    if (self){
        kAPIBaseURL				= kTwitterApiBaseUrl;        
        kOAuthRequestTokenURL	= kTwitterApiRequestToken;
        kOAuthAccessTokenURL	= kTwitterApiAccessTokenURL;
        kOAuthAuthorizeURL		= kTwitterApiAuthorizeURL;
		kOAuthCallBackURL		= kTwitterApiCallbackURL;
    }
    
    return self;
}

- (BOOL) isOAuthCallBackURL:(NSString *)hostName{
	return [hostName isEqualToString:kOAuthCallBackURL];
}


- (OAMutableURLRequest *)profileForCurrentUser {
	NSURL* url = [NSURL URLWithString:[kAPIBaseURL stringByAppendingString:@"/1.1/account/verify_credentials.json"]];
	OAMutableURLRequest *request = [self sendAPIRequestWithURL:url HTTPMethod:@"GET" body:nil];
    
    return request;
    
}




@end
